#2 new
Philipp Pirozhkov

Nesting contexts/shoulds using blocks

Reported by Philipp Pirozhkov | November 28th, 2008 @ 11:01 AM


Behave.context('A User instance') do
  should('return its full name') do
    assert('John Doe' == user.full_name)

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Behave is a testing framework dedicated to test Reia language and libraries

== Usage

Behave.context('A User instance') do
setup do
user = User.find(~first)

should('return its full name') do
assert('John Doe' == user.full_name)
assert('John' == user.name)
assert('Doe' == user.surname)

should('return its email address') do
'JohnDoe@gmail.com' == user.email

context('with a profile') do
user.profile = Profile.find(~first)

should('return true calling .has_profile?') do
user.has_profile()

People watching this ticket

Pages